package com.bstek.config;

import com.bstek.ureport.console.UReportServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

/**
 * 注入锐道报表uReport配置
 */
@Configuration
@ImportResource("classpath:ureport-console-context.xml")
public class UreportServletConfig {

    /**
     * 注册报表ureport
     * @return
     */
    @Bean
    public ServletRegistrationBean registrationUreportServlet(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(new UReportServlet(),"/ureport/*");
        registrationBean.setLoadOnStartup(1);
        return registrationBean;
    }

}
